package ymlTest

import (
	yaml "gopkg.in/yaml.v2"
	"io/ioutil"
)

type conf struct {
	Rabbit *rabbit `yaml:"rabbit"`
}
type rabbit struct {
	MqConnStr string `yaml:"mqConnStr"`
	Exchange  string `yaml:"exchange"`
	Queue     string `yaml:"queue"`
	QueueKey  string `yaml:"queueKey"`
	Kind      string `yaml:"kind"`
}

func ReadYmlByYamlV2(obj *conf, path string) (err error) {
	ymlTest, err := ioutil.ReadFile(path)
	if err != nil {
		return
	}
	err = yaml.Unmarshal(ymlTest, obj)
	if err != nil {
		return
	}
	return
}
